package nc.bs.hrhi.bp;

import java.util.List;

import nc.jdbc.framework.processor.ColumnListProcessor;
import nc.vo.pub.BusinessException;

public class FileTypeBp extends AbsPubOp{

	public List<String> execAll() throws BusinessException{
		
		String sql = "select name from smg_pay1_filetype where dr=0 order by code asc";
		
		List<String> list = (List<String>) getDao().executeQuery(sql, new ColumnListProcessor());
		
		return list;
	}
	
	public List<String> execByUserPower(String cuserid) throws BusinessException{
		
		String sql = "select smg_pay1_filetype.name from smg_pay1_filetype\r\n" + 
				"where EXISTS (\r\n" + 
				"select 1 from smg_pay_file_role left outer join sm_user_role on sm_user_role.pk_role = smg_pay_file_role.pk_role where smg_pay_file_role.pk_filetype = smg_pay1_filetype.pk_filetype and sm_user_role.cuserid = '"+cuserid+"'\r\n" + 
				")\r\n" + 
				" order by smg_pay1_filetype.code asc";

		List<String> list = (List<String>) getDao().executeQuery(sql, new ColumnListProcessor());
		
		return list;
	}

}
